package com.jbm.Community.Frame;

import com.jbm.Community.R;
import com.jbm.Community.R.layout;

import android.app.Activity;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;

public class RegUserActivity extends Activity {

	private AutoCompleteTextView mUserNameEdit = null;
	private EditText mPasswordEdit = null;
	private EditText mRePasswordEdit = null;
	private Button mRegButton = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_reg_user);
		
		this.mUserNameEdit = (AutoCompleteTextView)this.findViewById(R.id.reg_user_name);
		this.mPasswordEdit = (EditText)this.findViewById(R.id.reg_password);
		this.mRePasswordEdit = (EditText)this.findViewById(R.id.reg_repassword);
		this.mRegButton = (Button)this.findViewById(R.id.reg_button);
		
		String phoneCode = GetPhoneCode();
		if(!phoneCode.equals("") || phoneCode != null)
		{
			this.mUserNameEdit.setText(phoneCode);
		}

		this.mRegButton.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				
			}});
		
	}
	
	private String GetPhoneCode()
	{
		TelephonyManager tm = (TelephonyManager) this.getSystemService(TELEPHONY_SERVICE);
        String phoneNum=tm.getLine1Number();
        return phoneNum;
	}
}
